/******************************************************************************
 * Product: Adempiere ERP & CRM Smart Business Solution                        *
 * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software; you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. This program is distributed in the hope   *
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
 * See the GNU General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program; if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
package org.adempiere.apps.form;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import org.compiere.swing.CButton;
import org.compiere.util.Env;

/**
 *  Barcode Transaction Form Out for Retail
 *
 *  @author  Shindu
 *  @version 1.1
 *  @since May 2013
 */
public class BarcodeTransactionOutRetail extends BarcodeTransactionOut 
{
	private static final long serialVersionUID = 121224L;
	CButton addButton = new CButton(Env.getImageIcon2("Plus16"));
	

	/**
	 *  Static Init
	 *  @throws Exception
	 */
	protected void jbInit() throws Exception {
		super.jbInit();
		addButton.setToolTipText("Process barcode scan");
		//
		parameterStdPanel.add(barcodeLabel, new GridBagConstraints(0, 5, 1, 1,
				0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
				new Insets(5, 0, 5, 5), 0, 0));
		parameterStdPanel.add(barcodePN, new GridBagConstraints(1, 5, 1, 1,
				0.0, 0.0, GridBagConstraints.WEST,
				GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
		parameterStdPanel.add(barcodeQtyLabel, new GridBagConstraints(2, 5, 1, 1,
				0.0, 0.0, GridBagConstraints.EAST,
				GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
		parameterStdPanel.add(barcodeQty, new GridBagConstraints(3, 5, 1, 1,
				0.0, 0.0, GridBagConstraints.WEST,
				GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
		parameterStdPanel.add(addButton, new GridBagConstraints(4, 5, 1, 1,
				0.0, 0.0, GridBagConstraints.WEST,
				GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
		parameterStdPanel.add(infoInserted, new GridBagConstraints(5, 5, 1, 4,
				0.0, 0.0, GridBagConstraints.WEST,
				GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
		
		barcodeQty.addActionListener(this);
		addButton.addActionListener(this);
		barcodePN.setActionCommand("BarcodeEceran");
		addButton.setActionCommand("Barcode");
		
	} // jbInit

	/**
	 *  Dynamic Init (prepare dynamic fields)
	 *  @throws Exception if Lookups cannot be initialized
	 */
	protected void dynInit() throws Exception
	{
		super.dynInit();
		barcodeQtyLabel.setText("Item Qty");
		barcodeQtyLabel.setForeground(Color.BLUE);
		barcodeQtyLabel.setFont(barcodeLabel.getFont());
		barcodeQty.setValue(0.0);
		barcodeQty.setFont(barcodeLabel.getFont());
		barcodeQty.setForeground(Color.BLUE);
		isEceran.setSelected(true);
		
	}   //  dynInit
	
	/**
	 * Reset field after save
	 */
	protected void resetValue(){
		super.resetValue();
		barcodeQty.setValue(0.0);
		isEceran.setSelected(true);
	}
}
